1. Field of the Invention
This invention relates to memory management in computer systems and more particularly to garbage collection in a cache memory system.
2. Description of the Related Art
Modern dynamic and object-oriented languages use data structures that consist of small data objects referenced by pointers. The references to objects change quickly during the execution of a program, leaving objects with few or no references.
Garbage collection is a method to reuse memory that is occupied by data objects that are not referenced anymore. It is a form of automatic memory management. It is well known and has been improved over time. Garbage collection simplifies either the programming and/or enables algorithms that cannot keep track of object references efficiently. Garbage collection marks all objects that have a reference to it and reuses the memory that is occupied by all other objects. This assumes that the garbage collector can check all possible references. Hence, garbage collection allows data objects to be found in a program that cannot be accessed in the future, and reclaim the resources used by those objects.
The document U.S. Pat. No. 7,069,279 (B1) discloses a garbage collector for performing garbage collection that, from time to time, and within a single cycle, determines objects that are eligible to have their associated memory freed. The garbage collector relies on high-priority finalizers for determining eligible objects that are marked as ready for deallocation. The garbage collector, during a subsequent cycle, then deallocates the memory associated with marked objects.
The document U.S. Pat. No. 6,353,838 (B2) discloses an incremental garbage collector wherein, upon termination of a function or program, the incremental garbage collector scans the object heap for objects allocated by the function or program that are not referenced outside the function or program that allocated the objects. Memory occupied by such objects is immediately reclaimed without having to wait for the garbage collector.